package com.ruoyi.information.service.pc.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.information.mapper.pc.ApplyContactMapper;
import com.ruoyi.information.domain.pc.ApplyContact;
import com.ruoyi.information.service.pc.IApplyContactService;

/**
 * 一键联系Service业务层处理
 *
 * @author ruoyi
 * @date 2023-05-26
 */
@Service
public class ApplyContactServiceImpl implements IApplyContactService
{
    @Autowired
    private ApplyContactMapper applyContactMapper;

    /**
     * 查询一键联系
     *
     * @param id 一键联系主键
     * @return 一键联系
     */
    @Override
    public ApplyContact selectApplyContactById(Long id)
    {
        return applyContactMapper.selectApplyContactById(id);
    }

    /**
     * 查询一键联系列表
     *
     * @param applyContact 一键联系
     * @return 一键联系
     */
    @Override
    public List<ApplyContact> selectApplyContactList(ApplyContact applyContact)
    {
        return applyContactMapper.selectApplyContactList(applyContact);
    }

    /**
     * 新增一键联系
     *
     * @param applyContact 一键联系
     * @return 结果
     */
    @Override
    public int insertApplyContact(ApplyContact applyContact)
    {
        applyContact.setCreateTime(DateUtils.getNowDate());
        return applyContactMapper.insertApplyContact(applyContact);
    }

    /**
     * 修改一键联系
     *
     * @param applyContact 一键联系
     * @return 结果
     */
    @Override
    public int updateApplyContact(ApplyContact applyContact)
    {
        applyContact.setUpdateTime(DateUtils.getNowDate());
        return applyContactMapper.updateApplyContact(applyContact);
    }

    /**
     * 批量删除一键联系
     *
     * @param ids 需要删除的一键联系主键
     * @return 结果
     */
    @Override
    public int deleteApplyContactByIds(Long[] ids)
    {
        return applyContactMapper.deleteApplyContactByIds(ids);
    }

    /**
     * 删除一键联系信息
     *
     * @param id 一键联系主键
     * @return 结果
     */
    @Override
    public int deleteApplyContactById(Long id)
    {
        return applyContactMapper.deleteApplyContactById(id);
    }
}
